<?php
echo '<div id="Form" class="Account DiscussionExpirationSettings Preferences">';
if (ForceIncomingInt('Success', 0)) echo '<div id="Success">'.$this->Context->GetDefinition('ChangesSaved').'</div>';
echo '<fieldset>
	<legend>'.$this->Context->GetDefinition("DiscussionExpires").'</legend>
	'.$this->Get_Warnings().'
	'.$this->Get_PostBackForm('frmDiscussionExpire').'
	<ul>
            <li>
                <p class="Description"><strong>'.$this->Context->GetDefinition("DiscussionExpireCategory").'</strong></p>
                <p class="Description">Check: <a onclick="CheckAll(\'Category_\'); return false;" href="./">All</a>, <a onclick="CheckNone(\'Category_\'); return false;" href="./">None</a></p>
            </li>
            '.$this->CategoryCheckboxes.'

	</ul>
	<div class="Submit">
            <input type="submit" name="btnSave" value="'.$this->Context->GetDefinition('Save').'" class="Button SubmitButton" />
	    <a href="'.GetUrl($this->Context->Configuration, $this->Context->SelfUrl).'" class="CancelButton">'.$this->Context->GetDefinition('Cancel').'</a>
	</div>
    </form>
    </fieldset>
</div>';
echo '<div id="Form" class="Account DiscussionExpirationList Preferences">';
echo '<fieldset>
	<legend>'.$this->Context->GetDefinition("DiscussionExpiresList").'</legend>
	'.$this->Get_PostBackForm('frmDiscussionExpire').'
        <p class="Description"><strong>'.$this->Context->GetDefinition('DiscussionExpiresListNotes').'</strong></p>
        '.$this->GetExpirationList();
        if ($this->Error == 1) echo $this->List;
        else {
            echo '<div class="pagination">';
            if ($this->PageNo == 1) echo " First Prev ";
            else {
                echo " <a href='".$this->Context->Configuration['WEB_ROOT']."settings.php?PostBackAction=DiscussionExpiration&PageNo=1'>First</a> ";
                $prevpage = $this->PageNo-1;
                echo " <a href='".$this->Context->Configuration['WEB_ROOT']."settings.php?PostBackAction=DiscussionExpiration&PageNo=$prevpage'>Prev</a> ";
            }
            echo " ( Page $this->PageNo of $this->LastPage ) ";
            if ($this->PageNo == $this->LastPage) echo " Next Last ";
            else {
               $nextpage = $this->PageNo+1;
               echo " <a href='".$this->Context->Configuration['WEB_ROOT']."settings.php?PostBackAction=DiscussionExpiration&PageNo=$nextpage'>Next</a> ";
               echo " <a href='".$this->Context->Configuration['WEB_ROOT']."settings.php?PostBackAction=DiscussionExpiration&PageNo=$this->LastPage'>Last</a> ";
            }
            echo '</div>';

            //Veerle Css Table http://veerle.duoh.com/blog/comments/a_css_styled_table/
            echo '<table id="DiscussionList" cellspacing="0">
                <tr>
                    <th scope="col" width="5%" class="nobg">&nbsp;</th>
                    <th scope="col">Discussion title</th>
                    <th scope="col" width="30%">Expiration Date</th>
                </tr>
                '.$this->List.'
            </table>';
        }

echo '</form>
    </fieldset>
</div>';
?>
